import { createMemoryHistory, createRouter } from 'vue-router'


import BrowseRecord from '../view/BrowseRecord.vue'
import ProductRelease from "../view/ProductRelease.vue";
import Login from "../components/Login.vue";
import Main from "../components/Main.vue";
import index from "../components/index.vue"
import AwaitingPayment from "../view/OrderManagement/AwaitingPayment.vue";
import AwaitingShipment from "../view/OrderManagement/AwaitingShipment.vue";
import RoadingShipment from "../view/OrderManagement/RoadingShipment.vue";
import FinishingShipment from "../view/OrderManagement/FinishingShipment.vue";
import AllOrders from "../view/OrderManagement/AllOrders.vue";
import NoticeDetails from "../view/NoticeDetails.vue";
import ShopCart from "../view/ShopCart.vue"
import MyCenter from "../view/MyCenter.vue"
import GoodsDetails from "../view/GoodsDetails.vue";
import Goods_search from "../view/Goods/Goods_search.vue";
import GoodsIp from "../view/Goods/GoodsIp.vue";
import Register from "../view/Register.vue"
import Collection from "../view/Collection.vue"

const routes = [
    { path: '/',name:"/",meta:{title:"登录界面",power:10},component:Login},
    { path: '/Register',name:"Register",meta:{title:"注册界面",power:10},component:Register},
    { path: '/Main',name:"Main", meta:{title:"导航栏",power:10},component:Main,children:[
            { path: '',name:"index",meta:{title:"首页",power:20},component:index},
            { path: '/BrowseRecord',name:"BrowseRecord",meta:{title:"用户浏览记录界面",power:20},component:BrowseRecord},
            { path: '/ProductRelease',name:"ProductRelease",meta:{title:"商品发布界面",power:20},component:ProductRelease},
            { path: '/AwaitingPayment',name:"AwaitingPayment",meta:{title:"待付款订单",power:20},component:AwaitingPayment},
            { path: '/AwaitingShipment',name:"AwaitingShipment",meta:{title:"待发货订单",power:20},component:AwaitingShipment},
            { path: '/RoadingShipment',name:"RoadingShipment",meta:{title:"在途中订单",power:20},component:RoadingShipment},
            { path: '/FinishingShipment',name:"FinishingShipment",meta:{title:"已完成订单",power:20},component:FinishingShipment},
            { path: '/AllOrders',name:"AllOrders",meta:{title:"全部订单",power:20},component:AllOrders},
            { path: '/NoticeDetails/:noticeId',name:"NoticeDetails",meta:{title:"公告详情页",power:20},component:NoticeDetails},
            { path: '/GoodsDetails/:goodsId/:categoryId',name:"GoodsDetails",meta:{title:"商品详情页",power:20},component:GoodsDetails},
            { path: '/Goods_search/:goodsName',name:"Goods_search",meta:{title:"商品搜索页面",power:20},component:Goods_search},
            { path: '/GoodsIp/:categoryId',name:"GoodsIp",meta:{title:"商品IP",power:20},component:GoodsIp},
            { path: '/ShopCart',name:"ShopCart",meta:{title:"购物车",power:20},component:ShopCart},
            { path: '/MyCenter',name:"MyCenter",meta:{title:"个人中心",power:20},component:MyCenter},
            { path: '/Collection',name:"Collection",meta:{title:"我的收藏",power:20},component:Collection}
        ] },

]

const router = createRouter({
    history: createMemoryHistory(),
    routes,
})

export default router;